subjects[4] = "Computer Science" |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | subjects[4] = "Computer Science" |
subjects.pop(2) |
subjects.pop(2) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | subjects.pop(2) |
3 | subjects.pop(2) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
print(a) |
a = subjects.pop(4) |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | a = subjects.pop(4) |
3 | print(a) |
arr = ["red","blue","green","purple","orange"] |
1 | arr = ["red","blue","green","purple","orange"] |
print(arr) |
arr = ["red","blue","green","purple","orange"] |
print("Enter a colour") |
i = input() |
arr[0] = i |
1 | arr = ["red","blue","green","purple","orange"] |
2 | print("Enter a colour") |
3 | i = input() |
4 | arr[0] = i |
5 | print(arr) |
i = input() |
j = input() |
subjects[i] = j |
print("Enter a subject to replace it with") |
i = int(i) |
print(subjects[i]) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
print(subjects) |
print("Enter an index") |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter an index") |
3 | i = input() |
4 | i = int(i) |
5 | print(subjects[i]) |
6 | print("Enter a subject to replace it with") |
7 | j = input() |
8 | subjects[i] = j |
9 | print(subjects) |
print("Enter an index") |
i = int(i) |
print(subjects) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
subjects[i] = j |
print("Invalid integer") |
print(subjects[i]) |
if i.isdigit() and int(i) >= 0 and int(i) < len(subjects): |
break |
i = input() |
j = input() |
else: |
while True: |
print("Enter a subject to replace it with") |
print("Enter an index") |
        i = int(i) |
print(subjects) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
subjects[i] = j |
        print("Invalid integer") |
print(subjects[i]) |
    if i.isdigit() and int(i) >= 0 and int(i) < len(subjects): |
        break |
    i = input() |
j = input() |
    else: |
while True: |
print("Enter a subject to replace it with") |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter an index") |
3 | while True: |
4 |     i = input() |
5 |     if i.isdigit() and int(i) >= 0 and int(i) < len(subjects): |
6 |         i = int(i) |
7 |         break |
8 |     else: |
9 |         print("Invalid integer") |
10 | print(subjects[i]) |
11 | print("Enter a subject to replace it with") |
12 | j = input() |
13 | subjects[i] = j |
14 | print(subjects) |
print("Enter the subject you wish to replace it with") |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
print(subjects) |
i = input() |
for x in range(l): |
j = input() |
l = len(subjects) |
if subjects[x] == i: |
break |
print("Enter a subject you wish to replace") |
subjects[x] = j |
print("Enter the subject you wish to replace it with") |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
print(subjects) |
i = input() |
for x in range(l): |
j = input() |
l = len(subjects) |
    if subjects[x] == i: |
        break |
print("Enter a subject you wish to replace") |
        subjects[x] = j |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter a subject you wish to replace") |
3 | i = input() |
4 | print("Enter the subject you wish to replace it with") |
5 | j = input() |
6 | l = len(subjects) |
7 | for x in range(l): |
8 |     if subjects[x] == i: |
9 |         subjects[x] = j |
10 |         break |
11 | print(subjects) |
print("Add or Serve?") |
else: |
i = input() |
queue.append(i) |
print(queue) |
print("Queue") |
print("Adding " + i) |
while True: |
if i == "Add": |
print("Serving " + a) |
a = queue.pop(0) |
print("Enter someone to add") |
i = input() |
queue = [] |
    print("Add or Serve?") |
    else: |
        i = input() |
        queue.append(i) |
    print(queue) |
    print("Queue") |
        print("Adding " + i) |
while True: |
    if i == "Add": |
        print("Serving " + a) |
        a = queue.pop(0) |
        print("Enter someone to add") |
    i = input() |
queue = [] |
1 | queue = [] |
2 | while True: |
3 |     print("Queue") |
4 |     print(queue) |
5 |     print("Add or Serve?") |
6 |     i = input() |
7 |     if i == "Add": |
8 |         print("Enter someone to add") |
9 |         i = input() |
10 |         queue.append(i) |
11 |         print("Adding " + i) |
12 |     else: |
13 |         a = queue.pop(0) |
14 |         print("Serving " + a) |
15 |          |
even.append(a) |
else: |
for x in range(len(arr)): |
odd = [] |
print("Even") |
a = arr[x] |
odd.append(a) |
even = [] |
if a % 2 == 0: |
print(odd) |
arr = [6,5,4,5,6,2,4] |
print("Odd") |
print(even) |
        even.append(a) |
    else: |
for x in range(len(arr)): |
odd = [] |
print("Even") |
    a = arr[x] |
        odd.append(a) |
even = [] |
    if a % 2 == 0: |
print(odd) |
arr = [6,5,4,5,6,2,4] |
print("Odd") |
print(even) |
1 | arr = [6,5,4,5,6,2,4] |
2 | even = [] |
3 | odd = [] |
4 | for x in range(len(arr)): |
5 |     a = arr[x] |
6 |     if a % 2 == 0: |
7 |         even.append(a) |
8 |     else: |
9 |         odd.append(a) |
10 | print("Even") |
11 | print(even) |
12 | print("Odd") |
13 | print(odd) |
arr = [6,5,4,5,6,2,4] |
print(arr) |
for x in range(len(arr)): |
arr[x] = arr[x] * 2 |
arr = [6,5,4,5,6,2,4] |
print(arr) |
for x in range(len(arr)): |
    arr[x] = arr[x] * 2 |
1 | arr = [6,5,4,5,6,2,4] |
2 | for x in range(len(arr)): |
3 |     arr[x] = arr[x] * 2 |
4 | print(arr) |
print("Enter index 2") |
j = int(j) |
subjects = ["Science", "Maths", "English", "History", "Geography"] |
temp = subjects[i] |
i = int(i) |
print(subjects) |
subjects[i] = subjects[j] |
subjects[j] = temp |
i = input() |
print("Enter index 1") |
j = input() |
1 | subjects = ["Science", "Maths", "English", "History", "Geography"] |
2 | print("Enter index 1") |
3 | i = input() |
4 | i = int(i) |
5 | print("Enter index 2") |
6 | j = input() |
7 | j = int(j) |
8 | temp = subjects[i] |
9 | subjects[i] = subjects[j] |
10 | subjects[j] = temp |
11 | print(subjects) |
print(indexes) |
for x in range(len(arr)): |
arr = [5,2,2,1,4,5,2,4,5,2] |
if arr[x] == arr: |
indexes = [] |
index.append(x) |
print(indexes) |
for x in range(len(arr)): |
arr = [5,2,2,1,4,5,2,4,5,2] |
    if arr[x] == arr: |
indexes = [] |
        index.append(x) |
1 | arr = [5,2,2,1,4,5,2,4,5,2] |
2 | indexes = [] |
3 | for x in range(len(arr)): |
4 |     if arr[x] == arr: |
5 |         index.append(x) |
6 | print(indexes) |
t = 0 |
t = t + int(s[y]) |
for x in range(len(arr)): |
for y in range(len(s)): |
print(arr) |
s = str(arr[x]) |
arr = [242,142,525] |
arr[x] = t |
    t = 0 |
        t = t + int(s[y]) |
for x in range(len(arr)): |
    for y in range(len(s)): |
print(arr) |
    s = str(arr[x]) |
arr = [242,142,525] |
    arr[x] = t |
1 | arr = [242,142,525] |
2 | for x in range(len(arr)): |
3 |     t = 0 |
4 |     s = str(arr[x]) |
5 |     for y in range(len(s)): |
6 |         t = t + int(s[y]) |
7 |     arr[x] = t |
8 | print(arr) |
for x in range(len(arr)): |
t = 0 |
print(arr) |
s = str(arr[x]) |
for y in range(len(s)): |
t = t + int(s[y]) |
arr = [242,142,525] |
arr[x] = t |
for x in range(len(arr)): |
    t = 0 |
print(arr) |
    s = str(arr[x]) |
    for y in range(len(s)): |
        t = t + int(s[y]) |
arr = [242,142,525] |
    arr[x] = t |
1 | arr = [242,142,525] |
2 | for x in range(len(arr)): |
3 |     t = 0 |
4 |     s = str(arr[x]) |
5 |     for y in range(len(s)): |
6 |         t = t + int(s[y]) |
7 |     arr[x] = t |
8 | print(arr) |
9 |      |
s = str(arr[x]) |
arr = [242,142,525] |
for y in range(len(s)): |
arr[x] = t |
t = 0 |
print(arr) |
t = t + int(s[y]) |
for x in range(len(arr)): |
    s = str(arr[x]) |
arr = [242,142,525] |
    for y in range(len(s)): |
    arr[x] = t |
    t = 0 |
print(arr) |
        t = t + int(s[y]) |
for x in range(len(arr)): |
1 | arr = [242,142,525] |
2 | for x in range(len(arr)): |
3 |     t = 0 |
4 |     s = str(arr[x]) |
5 |     for y in range(len(s)): |
6 |         t = t + int(s[y]) |
7 |     arr[x] = t |
8 | print(arr) |
row = "" |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
else: |
row = row + "#" |
currentHeight = h - x |
if height[y] >= currentHeight: |
print(row) |
for y in range(len(height)): |
for x in range(5): |
row = row + " " |
    row = "" |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
        else: |
            row = row + "#" |
    currentHeight = h - x |
        if height[y] >= currentHeight: |
    print(row) |
    for y in range(len(height)): |
for x in range(5): |
            row = row + " " |
1 | height = [0,1,0,2,1,0,1,3,2,1,2,1] |
2 | |
3 | for x in range(5): |
4 |     currentHeight = h - x |
5 |     row = "" |
6 |     for y in range(len(height)): |
7 |         if height[y] >= currentHeight: |
8 |             row = row + "#" |
9 |         else: |
10 |             row = row + " " |
11 |     print(row) |
else: #No water and no terrain |
y = h - y #reverse the order, starting at 5 going to 0 |
row = row + " " |
water = [h,h,h,h,h,h,h,h,h,h,h,h] |
for y in range(len(height)): |
print(row) |
print(water) |
water[x] = y - 1 |
row = "" |
row = row + "#" |
for x in range(h): #This for loop prints out the map |
for x in range(len(water)): #Start from the left and move right |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
h = 5 |
elif water[y] >= currentHeight:#If the terrain is lower than the water level, draw the water |
if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
for y in range(h): |
for x in range(len(water)): #Start from the right and move left |
break |
if height[y] >= currentHeight: #If the terrain is equal to or higher than the water then print terrain |
x = len(height) - x - 1 |
row = row + colored.fg("blue") + "#" + colored.fg("white") |
water[x] = y - 1 |
import colored |
currentHeight = h - x |
if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
break |
        else: #No water and no terrain |
    y = h - y #reverse the order, starting at 5 going to 0 |
            row = row + " " |
water = [h,h,h,h,h,h,h,h,h,h,h,h] |
    for y in range(len(height)): |
    print(row) |
print(water) |
        water[x] = y - 1 |
    row = "" |
            row = row + "#" |
for x in range(h): #This for loop prints out the map |
    for x in range(len(water)): #Start from the left and move right |
height = [0,1,0,2,1,0,1,3,2,1,2,1] |
h = 5 |
        elif water[y] >= currentHeight:#If the terrain is lower than the water level, draw the water |
        if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
for y in range(h): |
    for x in range(len(water)): #Start from the right and move left |
            break |
        if height[y] >= currentHeight: #If the terrain is equal to or higher than the water then print terrain |
        x = len(height) - x - 1 |
            row = row + colored.fg("blue") + "#" + colored.fg("white") |
        water[x] = y - 1 |
import colored |
    currentHeight = h - x |
        if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
            break |
1 | import colored |
2 | height = [0,1,0,2,1,0,1,3,2,1,2,1] |
3 | |
4 | h = 5 |
5 | water = [h,h,h,h,h,h,h,h,h,h,h,h] |
6 | for y in range(h): |
7 |     y = h - y #reverse the order, starting at 5 going to 0 |
8 |      |
9 |     for x in range(len(water)): #Start from the left and move right |
10 |         water[x] = y - 1 |
11 |         if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
12 |             break |
13 |      |
14 |     for x in range(len(water)): #Start from the right and move left |
15 |         x = len(height) - x - 1 |
16 |         water[x] = y - 1 |
17 |         if y <= height[x]: #For each height keep decreasing the water height until you reach terrain |
18 |             break |
19 |      |
20 | print(water) |
21 |              |
22 | for x in range(h): #This for loop prints out the map |
23 |     currentHeight = h - x |
24 |     row = "" |
25 |     for y in range(len(height)): |
26 |         if height[y] >= currentHeight: #If the terrain is equal to or higher than the water then print terrain |
27 |             row = row + "#" |
28 |         elif water[y] >= currentHeight:#If the terrain is lower than the water level, draw the water |
29 |             row = row + colored.fg("blue") + "#" + colored.fg("white") |
30 |         else: #No water and no terrain |
31 |             row = row + " " |
32 |     print(row) |
33 |              |
34 |      |